const elasticsearch = require('elasticsearch');
const goodsesSearch = require('./goodses');

module.exports = function (elasticsearchConfig) {

    let searchClient = new elasticsearch.Client(elasticsearchConfig);

    return {
        searchEnable: elasticsearchConfig.searchEnable,
        goodsesSearch: goodsesSearch(searchClient, elasticsearchConfig.env)
    };
}